package com.hang.model.dto.base;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

public class BaseModel {
    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        if(ObjectUtil.isEmpty(pageNum) || pageNum <= 0){
            pageNum = 1;
        }
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if(ObjectUtil.isEmpty(pageSize) || pageSize < 10){
            pageSize = 10;
        }
        this.pageSize = pageSize;
    }

    @ApiModelProperty(value = "页码",required = true)
    private Integer pageNum;

    @ApiModelProperty(value = "页面大小",required = true)
    private Integer pageSize;
}
